package thirdassigment;

import thirdassigment.DirView;
//import secondassigment.DirViewTree;
//import secondassigment.Find;

public class Factory {
	ICommandExecutor ie;
public ICommandExecutor getExecutor(String command){
		 
		 if(command.equals("dir")){
	    	 ie = new DirView();
			 return ie;
	     }
		 
		 if(command.equals("tree")){
		
			 ie = new DirViewTree();
			 return ie;
		    
	 }
				
        if(("find").equals(command)){
			
			 ie = Find.getInstance();
			 return ie;
	}
        
		 if(("copy").equals(command)){
			 ie = Copy.getInstance();
			 return ie;
		 }
		 
		 if(("mkdir").equals(command)){
			 ie = MkDir.getInstance();
			 return ie;
		 }
		
		 if(("exit").equals(command)){
			 ie = Exit.getInstance();
			 return ie;
		 }
		 
		 if(("move").equals(command)){
			 ie = Move.getInstance();
			 return ie;
		 }
		 
		 if(("delete").equals(command)){
			 ie = Delete.getInstance();
			 return ie;
		 }
		return null;
	}
	
}
